<template>
  <tr>
    <td>
      <input
        type="checkbox"
        name=""
        id=""
        :checked="obj.checked"
        @change="$emit('changeCheck', obj.name, $event.target.checked)"
      />
    </td>
    <td>{{ obj.name }}</td>
    <td>{{ obj.price }}</td>
    <td>
      <button @click="$emit('changeNum', obj.num - 1)">-</button>
      <span>{{ obj.num }}</span>
      <button @click="$emit('changeNum', obj.num + 1)">+</button>
    </td>
    <td>{{ obj.num * obj.price }}</td>
    <td><button @click="$emit('del', obj.name)">删除</button></td>
  </tr>
</template>

<script>
export default {
  name: "ZuoYe1",
  components: {},
  props: {
    obj: {
      type: Object,
      require: true,
    },
  },
  data() {
    return {};
  },
  computed: {},
  watch: {},
  created() {},
  methods: {},
};
</script>

<style scoped></style>
